/*
 * list集合以及使用iterator进行遍历
 * */
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class ListTest {
    public static void main(String[] args) {
        List<String> list = new ArrayList<String>();
        list.add("a");
        list.add("b");
        list.add("c");
        list.add(3,"e");
        for (String s:list) {
            System.out.println(s);
        }
        Iterator<String> it=list.iterator();
        while(it.hasNext()) {
            String s= it.next();
            System.out.println(s);
        }
    }
}
